1. Technology Field
The present invention generally relates to a flash memory storage system, and more particularly, to a flash memory storage system that can identify data deleted by a host system in a flash memory and a flash memory controller and a data processing method thereof.
2. Description of Related Art
Along with the widespread of digital cameras, cell phones, and MP3 in recently years, the consumers' demand to storage media has increased drastically. Flash memory is one of the most adaptable memories for such battery-powered portable products due to its characteristics such as data non-volatility, low power consumption, small volume, and non-mechanical structure. A solid state drive (SSD) is a storage device which uses a NAND flash memory as its storage medium. Flash memory has been broadly used for storing important personal data thanks to its small volume and large capacity. Thereby, the flash memory industry has become a very important part of the electronic industry in recent years.
The flash memory chip in a flash memory storage apparatus has a plurality of physical blocks, and each of the physical blocks has a plurality of physical pages, wherein each physical block is an erasing unit of the flash memory chip while each physical page is a writing unit of the flash memory chip. Because a flash memory chip can only be programmed (i.e., written) in a single direction (i.e., the value of a memory cell thereof can only be programmed from 1 to 0), data cannot be directly written into a physical page that has been programmed before (i.e., a page contains data). Instead, the physical page has to be erased first before it can be programmed. In particular, since a flash memory chip is erased in unit of physical blocks, when a physical page containing old data is to be erased, the entire physical block corresponding to the physical page has to be erased. Since a flash memory is written in unit of physical pages while erased in unit of physical blocks, physical blocks in the flash memory are logically grouped into a system area, a data area, a spare area, and a replacement area by a flash memory controller of the flash memory storage apparatus. The physical blocks in the system area are used for storing important information related to the flash memory storage apparatus, and the physical blocks in the replacement area are used for replacing damaged physical blocks (i.e., bad blocks) in the data area or the spare area. Thus, a host system cannot access the physical blocks in the system area and the replacement area in a general access state. The physical blocks in the data area are used for storing valid data written by write commands, and the physical blocks in the spare area are used for substituting the physical blocks in the data area when the write commands are executed. To be specific, when a flash memory storage apparatus receives a write command from a host system and accordingly is about to write data into a physical block in the data area, the flash memory storage apparatus selects a physical block from the spare area and writes the old valid data in the physical block in the data area and the new data into the physical block selected from the spare area. Then, the flash memory storage apparatus logically links the physical block containing the new data to the data area and erases the original physical block in the data area and logically links it to the spare area. The flash memory storage apparatus provides logical addresses to the host system in order to allow the host system to smoothly access the physical blocks alternatively used for storing data. Namely, the flash memory storage apparatus reflects the alternation of the physical blocks by recording and updating the mapping relationship between the logical addresses and the physical blocks in the data area in a logical address-physical address mapping table. Thus, the host system simply writes data into a logical address while the flash memory storage apparatus accesses the corresponding physical address according to the logical address-physical address mapping table.
Generally speaking, a host system uses a file system to manage a peripheral storage device (for example, aforementioned flash memory storage apparatus) connected to the host system. When the host system is about to delete data previously stored in the peripheral storage device, the host system only updates the space information of the file system but does not instruct the peripheral storage device to actually delete the data. Thus, the control circuit of the peripheral storage device cannot get to know the data in which physical addresses is already deleted by the host system. In particular, taking the flash memory storage apparatus described above as an example, since the flash memory controller of the flash memory storage apparatus cannot determine whether the data in each physical address is already deleted by the host system or not, when the flash memory controller manages the physical blocks in the flash memory chip in the alternative pattern described above, it has to spend a lot of time to maintain the data already deleted by the host system. As a result, the write speed and efficiency of the flash memory storage apparatus are seriously affected.
Nothing herein should be construed as an admission of knowledge in the prior art of any portion of the present invention. Furthermore, citation or identification of any document in this application is not an admission that such document is available as prior art to the present invention, or that any reference forms a part of the common general knowledge in the art.